const vscode = require("vscode");

class operater{
    constructor(){
        this.ctx=null;
    }
    setCtx(ct){
        this.ctx=ct;
        this._init()
    }
    _init(){
        const view = vscode.window.createTreeView("daodan.operater", {
            treeDataProvider: this,
          });
        //   view.onDidChangeSelection(this.handle_node);
          this.ctx.subscriptions.push(view);
    }
    getTreeItem(ele) {
        // console.log('getTreeItem',ele)
        return ele;
      }
      getChildren(ele) {
        return [new globalState()]
      }
}
class globalState extends vscode.TreeItem{
    constructor() {
        super('本地数据', vscode.TreeItemCollapsibleState.None);
        this.tooltip = '本地数据';
        this.id = 'globalState_name_id';
        this.iconPath='runtime-extensions-editor-label-icon';
        this.type='globalState'
        this.command = {
            title: "打开配置页面",
            command: "daodan.openWeb",
            arguments: [{
                id: 'globalState_name_id',
                label: '本地数据',
                title: '本地数据',
                type: 'globalState',
              }],
          };
    }
    


}
module.exports = {
    operater,
  };